<?php
	// Muestro el Titulo del Estado
	echo '<h2>'. __($estadoproblemas[$id_estado],true).'</h2>';

	if(!empty($peopleproblems)){

		foreach ($peopleproblems as $problem):
?>

	<div id="<?php echo $problem['PeopleProblem']['id']; ?>" class="problemas_dragables">
		<table cellpadding="0" cellspacing="0" id="tabla_problemas"><tr><td style="padding: 4px;">
		<span style="width:56px;float: left;">
			<?php 
				echo $this->Html->link(
				    $this->Html->image("/images/ic_menu_delete.png", array('alt' => 'Borrar','title' => 'Borrar','width' => '15')),
				    "/people_problems/archivar/".$problem['PeopleProblem']['id']."/".$problem['PeopleProblem']['person_id']."/2",
				    array('escape'=>false),
				    "¿Confirma la eliminación del Problema ".$problem['Problem']['name']."?"
				);
			?>
			<?php // echo $ajax->link($html->image("/images/ico-practicas.gif", array('alt' => 'Evolucionar','title' => 'Evolucionar','width' => '15')), array('controller' => 'evolutions','action' => 'add', $id_paciente), array( 'update' => 'problema_nuevo', 'indicator' => 'cargando', 'escape'=> false)); ?>
			<?php 
				echo $this->Html->link(
				    $this->Html->image("/images/ico-archivar.png", array('alt' => 'Archivar','title' => 'Archivar','width' => '15')),
				    "/people_problems/archivar/".$problem['PeopleProblem']['id']."/".$problem['PeopleProblem']['person_id']."/3",
				    array('escape'=>false),
				    "¿Confirma que desea archivar el Problema ".$problem['Problem']['name']."?"
				);
			?>
			<?php 
				//echo $ajax->link($html->image("/images/ico-tag.gif", array('alt' => 'Etiquetar','title' => 'Etiquetar','width' => '15')),'/people_problems/edit/'.$problem['PeopleProblem']['id'].'/'.$id_paciente, array( 'update' => 'problema_nuevo', 'indicator' => 'cargando', 'escape'=> false));

			if(empty($problem['Tag']['name'])){
				echo '<A HREF="javascript:SetTag(\''.$problem['PeopleProblem']['id'].'\',\''.$id_paciente.'\')"><img id="img_tag_'.$problem['PeopleProblem']['id'].'" src="/images/star-off.gif" border="0"></A>';
			}else{
				echo '<A HREF="javascript:SetTag(\''.$problem['PeopleProblem']['id'].'\',\''.$id_paciente.'\')"><img id="img_tag_'.$problem['PeopleProblem']['id'].'" src="/images/star-on.gif" border="0"></A>';
			}
			?>
		</span>
		<span style="width:69%;float: left;"><?php echo $problem['Problem']['name']; ?></span>
		<span style="width:15%;float: left;"><?php echo date('d M Y', strtotime($problem['PeopleProblem']['fecha_origen'])); ?></span>
		</td></tr></table>
	</div>
<?php 
			echo $ajax->drag($problem['PeopleProblem']['id'],array('revert'=>true));
		endforeach; 
	}
?>